<template>
  <!-- 导航栏 -->
  <van-nav-bar title="充值记录" left-text="返回" left-arrow @click-left="goBack" />

  <div v-if="list.length > 0">
    <van-cell-group v-for="item in list" :key="item.id" center>
      <div class="van-cell van-cell--large">
        <div class="van-cell__title">
          <span>充值金额:￥{{ item.point }}</span>
          <span
            class="van-tag van-tag--danger"
            style="background: blue; margin-left: 5px"
            >{{ item.status_text }}</span
          >
          <div class="van-cell__label">备注信息:{{ item.content }}</div>
        </div>
        <div class="van-cell__value">
          <span>{{ item.createtime }}</span>
        </div>
      </div>
    </van-cell-group>
  </div>
  <div v-else>
    <div class="rate-empty">暂时无充值记录</div>
  </div>
</template>
<script setup>
const { cookies } = useCookies();
const router = useRouter();
const LoginUser = reactive(cookies.get("LoginUser"));
const list = ref([]);
const goBack = () => {
  router.push("/business/base/index");
};
onMounted(() => {
  rechargerecordList();
});
const rechargerecordList = async () => {
  let data = {
    busid: LoginUser.id,
  };
  let result = await Api.rechargerecord(data);
  if (result.code == "1") {
    list.value = result.data;
  }
};
</script>
<style>
.rate-empty {
  text-align: center;
  height: 55px;
  line-height: 50px;
  color: #666;
}
</style>
